<template>
  <div>
    <form @submit="submit" report-submit>
      <button form-type="submit" class="hidden-submit button-icon" :style="getStyle"></button>
    </form>
  </div>
</template>

<script>
  import { addFormId } from '@/api/common'

  export default {
    data() {
      return {
        isComponents: true
      }
    },
    props: {
      width: {
        type: String,
        default: 50
      },
      height: {
        type: String,
        default: 30
      }
    },
    computed: {
      getStyle() {
        return 'width: ' + this.width + 'px;' + 'height: ' + this.height + 'px;'
      }
    },
    methods: {
      submit: function(e) {
        const formId = e.mp.detail.formId
        console.log(formId)
        if (!this.getCustomerId) return
        // 发送到服务器保存
        addFormId(this.getCustomerId, formId).then((response) => {
        }).catch(() => {
        })
      }
    }
  }
</script>

<style scoped>
  .hidden-submit {
    /*background-color: #ff3600;*/
  }
</style>
